package com.goods.business.converter;

import com.goods.common.model.business.Health;
import com.goods.common.model.system.Menu;
import com.goods.common.model.system.User;
import com.goods.common.vo.business.HealthVO;
import com.goods.common.vo.system.MenuNodeVO;
import com.goods.common.vo.system.UserVO;
import org.springframework.beans.BeanUtils;
import org.springframework.util.CollectionUtils;

import java.util.ArrayList;
import java.util.List;


public class HealthConverter {

    /**
     * 转vo
     */
    public static HealthVO converterToHealthVO(Health health){
        HealthVO healthVO = new HealthVO();
        BeanUtils.copyProperties(health,healthVO);
        return healthVO;
    }

    /**
     * 转成healthVOList
     */
    public static List<HealthVO> converterToHealthVOList(List<Health> healthList){
        List<HealthVO> healthVOList = new ArrayList<>();
        if(!CollectionUtils.isEmpty(healthList)){
            for (Health health : healthList) {
                HealthVO healthVO = converterToHealthVO(health);
                healthVOList.add(healthVO);
            }
        }
        return healthVOList;
    }
}
